import { _decorator, Asset, Component, Node, resources, Slider, Sprite, SpriteFrame } from 'cc';
import BaseUI from '../framwork/BaseUI';
import AudioTools from '../framwork/Tools/AudioTools';
const { ccclass, property } = _decorator;

@ccclass('Game')
export class GameManager extends BaseUI {
    data: any;
    BaseUIonLoad(): void {
        let musicSlider = this.GetSlider("musicSlider");
        musicSlider.node.on("slide",(event)=>{
            AudioTools.playMusic("audio/bg",true,event.progress);
        })
        let audioSlider = this.GetSlider("audioSlider");
        audioSlider.node.on("slide",(event)=>{
            AudioTools.setClickVol(event.progress);
        })
    }
    BaseUIonDestroy(): void {

    }
    onBtn_click(target, onBtn_name): void {
        switch (onBtn_name) {
            case "btn_tujian":
                this.createUI("tujian/pfab_tujian",this.GetGameObject("view"),"data");
                break;
            case "btn_chouka":
                break;
            default:
                break;
        }
    }
    start() {
    }

    update(deltaTime: number) {
        
    }
}


